'''
Author: zhanwei xu
Date: 2023-05-02 15:04:22
LastEditors: zhanwei xu
LastEditTime: 2023-10-23 09:31:42
Description: 

Copyright (c) 2023 by zhanwei xu, Tsinghua University, All Rights Reserved. 
'''
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from FileAPI import view as FileView
from core import setting


app = FastAPI()
app.add_middleware(
    CORSMiddleware,
    allow_credentials=True,
    allow_origins=["https://zaiwen.top", "https://www.zaiwen.top","http://zaiwen.top", "http://www.zaiwen.top"],
    # allow_origins=["*"],
    allow_methods=["*"],
    allow_headers=["*"],
) 

@app.get("/")
async def main():
    return {"message":"Helloworld FastAPI"}


app.include_router(FileView.router)
    
